<?php
$id=$_GET['id'];
$sql="select hinhdaidien from dm_sanpham_danhmuc where id=".$id;
$rs=mysql_query($sql);
$r=mysql_fetch_assoc($rs);
if(file_exists("../images/hinhdaidien/".$r['hinhdaidien'])) {unlink("../images/hinhdaidien/".$r['hinhdaidien']);}

$sql="delete from dm_sanpham_danhmuc where id=".$id;
mysql_query($sql);
echo'<script>window.location="?action=sanpham_danhmuc";</script>';
?>